Skip to content

fix(runtime): give every docker sandbox the host-gateway mapping - #1174

Open
zjordon wants to merge 1 commit into
Tencent:mainfrom
zjordon:fix/sandbox-host-gateway
Open

zjordon wants to merge 1 commit into
Tencent:mainfrom
zjordon:fix/sandbox-host-gateway

Conversation

@zjordon

@zjordon zjordon commented Nov 21, 2026

Copy link
Copy Markdown

Problem

On a native Linux install (bash scripts/dev.sh), an SOP run sandbox cannot reach the session gateway. Every sandbox receives AGENTFLOW_SESSION_GATEWAY as a host.docker.internal URL (conversationDockerAccess picks that host when the platform itself is not containerized, internal/runtime/conversation_network.go), but the --add-host host.docker.internal:host-gateway mapping was only appended for conversation and runner-login containers (ConversationRoot != "" || RunnerLoginRelay, internal/runtime/sandbox_docker.go). Linux daemons do not resolve host.docker.internal without that mapping, so inside an SOP run sandbox:

$ git credential fill
fatal: dial tcp: lookup host.docker.internal on 192.168.5.1:53: no such host

In practice the 发起 MR node's agent had to rediscover the docker bridge gateway on every run (read /proc/net/route, probe the gateway port, override AGENTFLOW_SESSION_GATEWAY with the bridge IP) before git credential fill returned x-access-token.

Resulting behavior

docker create for every sandbox now carries --add-host host.docker.internal:host-gateway, matching the URL a native install already advertises. git credential fill resolves the gateway directly; conversation and runner-login containers are unchanged (they already had the mapping). No engine/repository/handler boundary change and no schema or runner-protocol compatibility change.

Validation

  • internal/runtime/docker_cases_test.go: the relay-network test previously asserted SOP sandboxes do not receive the mapping (the codified bug); it now asserts every case (SOP, SOP with private home, conversation, runner-login relay) receives it.
  • Behavior verified on a native Linux deployment: before the patch, git credential fill failed with the DNS error above inside an SOP run sandbox; after rebuilding, credential fill resolves host.docker.internal and returns the injected token.
  • Not run locally: the full Go suite, go vet, the chatbot build and the public browser suites (no Linux toolchain on the author machine); relying on this repository's core/browser/first-run jobs for those.

AGENTFLOW_SESSION_GATEWAY hands a native install's sandboxes a
host.docker.internal URL, but --add-host host.docker.internal:host-gateway
was only added for conversation and runner-login containers, so git
credential fill in an SOP run sandbox failed with "lookup
host.docker.internal ... no such host" and the MR node had to rediscover
the docker bridge gateway on every run. Add the mapping to all sandboxes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant